let vm = new Vue({
    el: ".containerMyBox",
    data: {
        params: {
            checked: true
        },
    },
    methods: {
        doLogin: function () {
            axios({
                url: 'user/doLogin',
                method: 'post',
                data: this.params
            }).then(response => {
                console.log(response.data);
                let vmUserInfo = response.data;
                if (vmUserInfo.data != undefined) {
                    sessionStorage.setItem("vmUserInfo", JSON.stringify(vmUserInfo));
                    alert(vmUserInfo.message);
                    location.href = 'home';
                } else {
                    alert(vmUserInfo.message)
                }

            })
        },
        changeCode: function () {
            $('#code').attr('src', 'code.png?' + new Date());
        },
    },
    created: function () {//vue对象创建后执行

    },
    //挂载结束 该状态结束、表示全部元素都已生成
    mounted() {
        //将Vue方法传到全局对象window中
        window.waitKeyCode = this.doLogin;
    },
});